/*    */ package com.qmsk.business.activity.activityrpt.dao;
/*    */ 
/*    */ import com.qmsk.business.sys.basic.SupportDAO;
/*    */ import com.utils.basic.MapUtils;
/*    */ import com.utils.gson.in.GsonHeadOneRow;
/*    */ import com.utils.gson.out.GsonEbRst;
/*    */ import java.sql.SQLException;
/*    */ import java.util.Date;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ 
/*    */ public class ActivityRptDAO extends SupportDAO
/*    */ {
/*    */   public GsonEbRst getGsonOfAll(Map<String, Object> params, Integer nPageIdx, Short nPageSize)
/*    */     throws SQLException
/*    */   {
/* 25 */     return getGsonOfParams("selectSqlOfAll", params, nPageIdx, 
/* 26 */       nPageSize, true);
/*    */   }
/*    */ 
/*    */   public GsonEbRst getGsonOfId(String id) throws SQLException {
/* 30 */     Map params = new HashMap();
/* 31 */     MapUtils.addToMap(params, "id", id);
/* 32 */     return getGsonOfParams("selectSqlOfAll", params, false);
/*    */   }
/*    */ 
/*    */   public int updateCheckedOfIds(String userName, String id) throws SQLException
/*    */   {
/* 37 */     Object[] strParams = { userName, id };
/* 38 */     return update("updateCheckedOfIds", strParams);
/*    */   }
/*    */ 
/*    */   public int updateStatusOfActId(String userName, Long id, Integer status) throws SQLException
/*    */   {
/* 43 */     if (status.intValue() == 3) {
/* 44 */       HashMap params = new HashMap();
/* 45 */       MapUtils.addToMap(params, "actId", id);
/* 46 */       return update("updateFinishOfActId", params);
/*    */     }
/* 48 */     Map params = new HashMap();
/* 49 */     MapUtils.addToMap(params, "actId", id);
/* 50 */     MapUtils.addToMap(params, "userName", userName);
/* 51 */     return update("updateCancelOfActId", params);
/*    */   }
/*    */ 
/*    */   public int updateStatusOfId(String userName, Long id, Integer status)
/*    */     throws SQLException
/*    */   {
/* 57 */     if (status.intValue() == 3) {
/* 58 */       Map params = new HashMap();
/* 59 */       MapUtils.addToMap(params, "id", id);
/* 60 */       return update("updateFinishOfActId", params);
/*    */     }
/* 62 */     String[] heads = { "cancelDate", "cancelMan", 
/* 63 */       "status", "id" };
/* 64 */     Object[] datas = { new Date(), userName, status, id };
/* 65 */     return updateJsonOneRow(new GsonHeadOneRow(heads, datas));
/*    */   }
/*    */ 
/*    */   public int insertActivityInfoByCustId(String openId)
/*    */     throws SQLException
/*    */   {
/* 74 */     Object[] params = { openId };
/* 75 */     return update("insertByOpenId", params);
/*    */   }
/*    */ 
/*    */   public int isExistByActIdAndCustId(Long actId, Long cusId) throws SQLException {
/* 79 */     Object[] params = { actId, cusId };
/* 80 */     return queryForInt("isExistByActIdAndCustId", params, Integer.valueOf(0)).intValue();
/*    */   }
/*    */ 
/*    */   public int isExistByActIdAndOpenId(Long actId, String openId) throws SQLException {
/* 84 */     Object[] params = { actId, openId };
/* 85 */     return queryForInt("isExistByActIdAndOpenId", params, Integer.valueOf(0)).intValue();
/*    */   }
/*    */ 
/*    */   public int insertInfo(Long actId, Long cusId, String linkPhone, String linkMan, String idNumber, Integer status, Date auditDate, String address, int i, String openId)
/*    */     throws SQLException
/*    */   {
/* 91 */     Object[] params = { actId, cusId, linkPhone, linkMan, idNumber, status, auditDate, address, Integer.valueOf(i), openId };
/* 92 */     return update("insertInfo", params);
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.activity.activityrpt.dao.ActivityRptDAO
 * JD-Core Version:    0.5.3
 */